package com.zbl.zblproject.contract.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2019/3/14
 * 利率
 */
@TableName("zbl_rebates")
public class Rebates {

    /**
     * ID编号
     */
    @TableId(type = IdType.AUTO)
    private int rebatesId;

    /**
     * 对应合同ID
     */
    private int contractId;

    /**
     * 采购金额
     */
    private BigDecimal saleroom;

    /**
     * 对应返点率
     */
    private BigDecimal rebatesRate;

    private int isEnable;

    public int getRebatesId() {
        return rebatesId;
    }

    public void setRebatesId(int rebatesId) {
        this.rebatesId = rebatesId;
    }

    public int getContractId() {
        return contractId;
    }

    public void setContractId(int contractId) {
        this.contractId = contractId;
    }

    public BigDecimal getSaleroom() {
        return saleroom;
    }

    public void setSaleroom(BigDecimal saleroom) {
        this.saleroom = saleroom;
    }


    public String getFormatSaleroom(){
        if(saleroom == null){
            return "0.00";
        }
        DecimalFormat df = new DecimalFormat("#0.00");
        return df.format(saleroom);
    }

    public BigDecimal getRebatesRate() {
        return rebatesRate;
    }

    public void setRebatesRate(BigDecimal rebatesRate) {
        this.rebatesRate = rebatesRate;
    }

    public int getIsEnable() {
        return isEnable;
    }

    public void setIsEnable(int isEnable) {
        this.isEnable = isEnable;
    }
}
